package love.actions;

import love.model.Carte;
import love.model.ETypeCarte;

public class ActionFactory {

	private static ActionFactory _instance;
	
	private ActionFactory(){
	}
	
	public static ActionFactory getInstance(){
		if(_instance == null)
			_instance = new ActionFactory();
		return _instance;
	}
	
	public AbstractAction getAction(Carte carte){
		AbstractAction action = null;
		if(carte.getType().equals(ETypeCarte.GUARD)){
			action =  new GardeAction();
		}
		if(carte.getType().equals(ETypeCarte.PRIEST)){
			action =   new PretreAction();
		}
		if(carte.getType().equals(ETypeCarte.BARON)){
			action =   new BaronAction();
		}
		if(carte.getType().equals(ETypeCarte.HANDMAID)){
			action =   new ServanteAction();
		}
		if(carte.getType().equals(ETypeCarte.PRINCE)){
			action =   new PrinceAction();
		}
		if(carte.getType().equals(ETypeCarte.KING)){
			action =   new RoiAction();
		}
		if(carte.getType().equals(ETypeCarte.COUNTESS)){
			action =   new ComtesseAction();
		}
		if(carte.getType().equals(ETypeCarte.PRINCESS)){
			action =   new PrincesseAction();
		}
		if(action != null)
			action.setCarte(carte);
		return action;
	}
}
